extends ./layouts/default

block title
    title Koa douban 首页

block content  
    include ./includes/header
    .container-fluid    
        .sider
        .content
            .row
                .col-md-6
                    .card
                    img.card-img-top(src="./image/1.jpg",
                    data-video='/')
                    .card-body  
                    h4.card-title 这是电影标题
                    p.card-desc 这是电影描述
                    .card-footer
                    small.text-muted 一天前更新
                .col-md-6
                    .card
                    img.card-img-top(src="./image/1.jpg",
                    data-video='/')
                    .card-body  
                    h4.card-title 这是电影标题
                    p.card-desc 这是电影描述
                    .card-footer
                    small.text-muted 一天前更新
            .row
                .col-md-6
                    .card
                    img.card-img-top(src="./image/1.jpg",
                    data-video='/')
                    .card-body  
                    h4.card-title 这是电影标题
                    p.card-desc 这是电影描述
                    .card-footer
                    small.text-muted 一天前更新
                .col-md-6
                    .card
                    img.card-img-top(src="./image/1.jpg",
                    data-video='/')
                    .card-body  
                    h4.card-title 这是电影标题
                    p.card-desc 这是电影描述
                    .card-footer
                    small.text-muted 一天前更

#myModel.model.fade

include ../includes/script

script. 
    var player = null;

    $(document).ready(function(){
        $('#myModel').on('hidden.bs.model',function(e){
            if(player && player.pause) player.pause()
        })

        $(".card-img-top").click(function(e){
            var image = $(this).attr('video')
            var video = $(this).data("video")

            $('#myModel').model("show")

            if(!player){
                player = new DPlayer({
                    container:document.getElementByID("videoModel")
                    screenshot:ture,
                    video:{
                        url:video,
                        pic:image,
                        thumbnails:image
                    }
                })
            }else{
                player.switchVideo({
                    url:video,
                    pic:image,
                    type:'auto'
                })
            }
        })
    })